cmake_minimum_required(VERSION 3.5)
project(record)

add_compile_options(-std=c++17)

find_package(ament_cmake REQUIRED)
find_package(agv_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclpy REQUIRED)
find_package(std_msgs REQUIRED)
find_package(std_srvs REQUIRED)
find_package(Boost REQUIRED COMPONENTS thread system chrono)
find_package(shared_parameters REQUIRED)

# SET(CMAKE_BUILD_TYPE "Debug")
# SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
  include/record
  include/linux
  include/linux/can
)

add_executable(${PROJECT_NAME}_node src/record_pack.cpp src/zipper.cpp src/canlog.cpp src/lib.c)

ament_target_dependencies(${PROJECT_NAME}_node
  "std_srvs"
  "agv_msgs"
  "rclcpp"
  "shared_parameters"
)

target_link_libraries(${PROJECT_NAME}_node
  ${Boost_LIBRARIES}
  zip
)
ament_package()

install(PROGRAMS 
  config/rosconsole.config 
  config/python_logging.config
  DESTINATION ${CMAKE_INSTALL_PREFIX}/tools/config
)

install(TARGETS ${PROJECT_NAME}_node
  ARCHIVE DESTINATION lib
  LIBRARY DESTINATION lib
  RUNTIME DESTINATION lib/${PROJECT_NAME}
)

